<template>
  <div class="msg_page">
    <div class="title">{{ details.title }}</div>
    <div class="time">{{ details.createTime }}</div>
    <div class="content" v-html="details.content"></div>
  </div>
</template>
<script>
import { getCmsArticleDetail } from "@/api/api";
export default {
  data() {
    return {
      details: {},
    };
  },
  created() {
    if (this.$route.query.typeS == 'gonggao') {
      document.title = "公告头条详情"
    } else if (this.$route.query.typeS == 'zixun') {
      document.title = "健康资讯详情"
    }
    this.getCmsArticleDetail(this.$route.query.id);
  },
  methods: {
    getCmsArticleDetail(id) {
      var data = {
        id,
      };
      getCmsArticleDetail(data).then((res) => {
        if (res.code == 200) {
          this.details = res.data;
        }
      });
    },
  },
};
</script>
<style lang="less" scoped>
.msg_page {
  width: calc(~"100% - 2rem");
  padding: 0 1rem;

  .title {
    text-align: center;
    font-size: 17px;
    font-family: PingFang SC;
    font-weight: bold;
    color: #131a2a;
    line-height: 42px;
  }

  .time {
    text-align: center;
    font-size: 13px;
    font-family: PingFang SC;
    font-weight: 500;
    color: #a4adbe;
    line-height: 20px;
  }

  .content {
    width: 100%;
    font-size: 14px;
    font-family: PingFang SC;
    font-weight: 500;
    color: #3f4551;
    line-height: 24px;
    word-break: break-all;
  }
}
</style>